//
//  TravelsAuthor_LoveCollectionViewCell.m
//  艾听歌
//
//  Created by dllo on 16/5/28.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "TravelsAuthor_LoveCollectionViewCell.h"

@implementation TravelsAuthor_LoveCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame{
    
    self = [super initWithFrame:frame];
    
    if (self) {
        
        [self createSubViews];
    }
    return self;
    
}

- (void)createSubViews{
    
    self.myImageView = [[UIImageView alloc]init];
//    self.myImageView.backgroundColor = [UIColor yellowColor];
    [self.contentView addSubview:self.myImageView];
    self.myImageView.userInteractionEnabled = YES;
    
    UITapGestureRecognizer *photoTap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(toPhotoDetails)];
    
    [self.myImageView addGestureRecognizer:photoTap];
    
}


- (void)layoutSubviews{
    
    [super layoutSubviews];
    
    self.myImageView.frame = self.contentView.bounds;
    
    [self.myImageView sd_setImageWithURL:[NSURL URLWithString:self.cellModel.photo_url] placeholderImage:[UIImage imageNamed:@"holderr"]];
}


//图片的轻拍方法
- (void)toPhotoDetails{
    
    [[NSNotificationCenter defaultCenter] postNotificationName:@"toTripsPhotoDetails" object:self.cellModel];
    
    
}


@end
